<?php namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

class Domains extends Model {

	//
	protected $table = 'domains';
	protected $fillable = ['cate_name', 'parent_id'];


	public function parent()
	{
		return $this->hasOne("App\Models\Domains", 'id', 'parent_id');
	}

	public function children()
	{
		return $this->hasMany("App\Models\Domains", "parent_id", "id");
	}

	// public function siblings()
	// {
	// 	return $this->hasMany("App\Models\Domains", "parent_id", "parent_id");
	// }

}
